import multiprocessing
import logging
import sys
import time

logging.basicConfig(
    level=logging.INFO,
    format="%(name)s%(process)d%(processName)s%(thread)d%(message)s",
    stream=sys.stdout
)
log=logging.getLogger(__name__)

def worker(k):
    time.sleep(2)
    log.info(f'正在打印{k}')
    return k+5

if __name__ == '__main__':
    p=multiprocessing.Pool(4)
    for i in range(5):
        req=p.apply(worker,args=(i,))
        log.info(f'~~~~~~{req}~~~~~~~~~~~~~~~~~')
    print('--------')


